/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Shared;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import Module.ActionList;
import Module.DecisionList;
import Module.Resource;
import Module.ResourceProject;
import Module.ResourceType;
import Module.User;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;

/**
 *
 * @author thorerikmidtb
 * Defines the interface that is used by the client and implemented by the server.
 * And as you can see, we have the Callback interface as an argument in these methods.
 *
 */
public interface Server extends Remote {


    int registerProject(String name, String description, String goals,String projectLeader) throws RemoteException;

    void editProject(int id, String name, String description, String goals,String projectLeader) throws RemoteException;

    void deleteProject(int id)throws RemoteException;

    ArrayList<Module.Project> getAllProjects() throws RemoteException;

    Module.Project getProject(int id) throws RemoteException;

    ArrayList<Module.Project> getAllProjectsToUser(String user) throws RemoteException;

    int registerSession(String name, String date, String place, int projectId,String startTime, String endTime,
            String evaluation, String preparation) throws RemoteException;

    void editSession(int id,int projectId, String name, String time, String place,String startTime,String endTime,
            String evaluation,String preparation ) throws RemoteException;

    void removeUsersFromSession(int sessionId) throws RemoteException;

    void deleteSession(int id) throws RemoteException;

    boolean loginn(String username, String password) throws RemoteException;

    void registerActivity(int projectId,String activityName, String startDate, String endDate,
            String responsible, String status, String description, String goals, String location,
            boolean onActionList) throws RemoteException;

    void editActivity(int id, int projectId,String activityName, String startDate, String endDate,
            String responsible, String status, String description, String goals, String location,
            boolean onActionList) throws RemoteException;

    void deleteActivity(int id)throws RemoteException;

    ArrayList<Module.Activity> getAllActivities(int projectId) throws RemoteException;

    ArrayList<Module.Session> getAllSessionsToProject(int id) throws RemoteException;

    ArrayList<Module.User> getAllUsers()throws RemoteException;

    Module.User registerUser(String workplace,String fullname, String expertise,String username) throws RemoteException;

    void registerRoleToUser(int userId, ArrayList<String> rolles) throws RemoteException;

    ArrayList<String> getRoleToUser(int userId) throws RemoteException;

    void editUser(Module.User u) throws RemoteException;

    ArrayList<Module.Session> getAlleSessionsToUser(int userId)throws RemoteException;

    void editUserInfo(User u, String fullname, String expertise, String workplace) throws RemoteException;

    ArrayList<Module.addUserRoles> getUserRolesProject(int projectID, int teamID)throws RemoteException;

    boolean isCorrectPassword(String username, String password) throws RemoteException;

    //ArrayList<Module.User> getProjectLeader() throws RemoteException;

    //ArrayList<Module.User> getAvailabeSecretaries(int projectId) throws RemoteException;

    //ArrayList<Module.User> getSecretaries() throws RemoteException;

   // ArrayList<Module.User> getAvailabeFasilitatores(int projectId) throws RemoteException;

    //ArrayList<Module.User> getFasilitator() throws RemoteException;

    void editDecisionList(ArrayList<DecisionList> decisionList, int projectId)throws RemoteException;

    void registerDecisionList(DecisionList decisionList)throws RemoteException;

    void registerUserToProject(int projectId, ArrayList<Module.User> users,int teamId,int roleID) throws RemoteException;

    void delteUsertoProject(int projectId) throws RemoteException;

    void deleteTeam(int teamId) throws RemoteException;

    ArrayList<String> getAllPlaces()throws RemoteException;

    ArrayList<String> getRoleToUserProject(int userId, int projectId)throws RemoteException;

    ArrayList<String> getRoleToUserSession(int userId, int sessionId)throws RemoteException;

    void registerUserToSession(int sessionId, ArrayList<User> users, int roleId, int teamId) throws RemoteException;

    Module.User getUserForUsername(String username) throws RemoteException;
    
    //Module.User getFacilitatorForSession(int sessionId) throws RemoteException;

    //Module.User getSecretaryForSession(int sessionId) throws RemoteException;

    ArrayList<Module.User> getExpertsForSession(int sessionId) throws RemoteException;

    //Module.User getProjectLeader(int projectId) throws RemoteException;

    ArrayList<Module.User> getProjectParticipants(int projectId) throws RemoteException;

    ArrayList<Module.ChattLog> getChattLogToProject(int projectId) throws RemoteException;

    //boolean isUsernameRegistered(String username) throws RemoteException;

    int registerTeam(String name)throws RemoteException;

    void editTeam(int id, String name)throws RemoteException;

    ArrayList<Module.Team> getTeamsToProject(int projectId)throws RemoteException;

    ArrayList<Module.User> getUsersToTeam(int teamId)throws RemoteException;

    ArrayList<Module.Team> getTeamInfoToSession(int sessionId) throws RemoteException;

    int registerResourceType(String name)throws RemoteException;

    int[] registerResource(String name, String resourceTypeName, int resourceTypeId)throws RemoteException;

    String registerResourceToProject(ResourceProject resources)throws RemoteException;

    void deleteResourceToProject(int projectId, int resourceId)throws RemoteException;

    ArrayList<ResourceProject> getResourceToProject(int projectId)throws RemoteException;

    void registerTeamSession(int teamId, int sessionId, String teamGoal, String teamDelivery)throws RemoteException;

    void editTeamSession(int teamId, int sessionId, String teamGoal, String teamDelivery)throws RemoteException;

    ArrayList<DecisionList> getDecisionListToProject(int projectId)throws RemoteException;

    ArrayList<ActionList> getActionListToProject(int projectId)throws RemoteException;

    boolean insertIntoVoiceList(int projectId, int userId)throws RemoteException;
    
    void removeFromVoiceList(int projectId, int userId)throws RemoteException;
    
    void removeVoiceList(int projectId)throws RemoteException;

    void editDecionListIntro(int projectId, String intro)throws RemoteException;

    void editActionListIntro(int projectId, String intro)throws RemoteException;

    String getActionListIntro(int projectId)throws RemoteException;

    String getDecisionListIntro(int projectId)throws RemoteException;

    void editActionList(ArrayList<ActionList> liste)throws RemoteException;

    ArrayList<ResourceType> getAllResourceType()throws RemoteException;

    ArrayList<Resource> getAllResources()throws RemoteException;


    void connect(Callback c, String ip) throws RemoteException;

    void sendProjectUpdates(Callback c) throws RemoteException;

    void sendDecisionListUpdates(Callback c) throws RemoteException;

    void sendActivityUpdates(Callback c) throws RemoteException;

    void sendUserListUpdates(Callback c) throws RemoteException;

    void sendVoiceListUpdates(Callback c) throws RemoteException;
    ArrayList<User> getVoiceListUsers(int projectId) throws RemoteException;

    void sendCountDownStarts(Callback c, int min) throws RemoteException;

    void sendCountDownStops(Callback c) throws RemoteException;

    void sendCountDownResumes(Callback c) throws RemoteException;
   
    void sendSessionUpdates(Callback c) throws RemoteException;

    void sendActionlistUpdates(Callback c) throws RemoteException;

    void sendResourceUpdates(Callback c) throws RemoteException;
    void checkCallbacks() throws RemoteException;
    /**
     * This is used by a client who wants to connect to the chat.
     * @param c
     * @throws RemoteException
     */
    void connectChat(Callback c,String ip) throws RemoteException;

    /**
     * This is used by a client when they want to speak to everyone, or for typing in commands.
     * @param message
     * @param c
     * @throws RemoteException
     */
    void broadcast(String message, Callback c) throws RemoteException;


    /**
     * This is used by a client when they want to disconnect/quit from the server.
     * @param c
     * @throws RemoteException
     */
    void quit(Callback c, String ip) throws RemoteException;

}

